package com.hzy.pms.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.hzy.pms.domain.bo.ProductCategoryBo;
import com.hzy.pms.domain.vo.ProductCategoryVo;
import com.hzy.pms.service.IProductCategoryService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 商品分类
 *
 * @author zengxin
 * @date 2023-10-17
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/pms/category")
public class ProductCategoryController extends BaseController {

    private final IProductCategoryService iProductCategoryService;

    /**
     * 查询商品分类列表
     */
    @GetMapping("/all")
    public R<List<ProductCategoryVo>> all(ProductCategoryBo bo) {
        List<ProductCategoryVo> list = iProductCategoryService.queryWebList(bo);
        return R.ok(list);
    }

    @GetMapping("/list")
    public R<List<ProductCategoryVo>> list(ProductCategoryBo bo) {
        return R.ok(iProductCategoryService.queryWebList(bo));
    }

}
